#include <string>
#include <iostream>
using namespace std;

int printStr(const string &str)
{
    cout << "str: " << str << " len:" << str.length() << endl;
    return str.length();
}

int (*pf1) (const string &str);


void fcTest1()
{
    pf1 = printStr; // pf1 = &printStr;
    int len = pf1("hello world!");
    cout << "Return len: " << len << endl;
}


void strCompTest1()
{
    string str1 = "123";
    string str2 = "0";
    cout << str1.compare(str2) << endl;
}
void strCompTest2(){
    string str1 = "getInfo --version";
    // string str2 
    string::size_type idx;
    idx = str1.find("hello");
    cout << (idx == string::npos) << endl;
    idx = str1.find_first_of("hh");
    cout << (idx == string::npos) << endl;
    
}
